<template>
  <div>
    <van-nav-bar title="我的购物车" left-arrow @click-left="$router.go(-1)" />
    <div class="goods">
      <van-card
        :num="item.num"
        :price="item.price"
        :title="item.name"
        v-for="item in list"
        :key="item.id"
      >
      <template #thumb>
        <input type="checkbox" v-model="item.checked" />
        <img :src="item.pic" alt="" style="width:75px;height:80px">
      </template>
      <template #num>
        <van-stepper v-model="item.num"></van-stepper>
      </template>
        <template #footer>
          <van-button size="mini">删除</van-button>
        </template>
      </van-card>
    </div>
    <van-submit-bar :price="total * 100" button-text="提交订单">
      <van-checkbox v-model="checked">全选</van-checkbox>
    </van-submit-bar>
  </div>
</template>

<script>
import {mapGetters} from 'vuex';
export default {
  data() {
    return {
      list: this.$store.state.cart,
      checked:true,
    };
  },
  created() {},
  mounted() {},
  methods: {},
  computed: {
    ...mapGetters(['total'])
  },
};
</script>

<style scoped lang="scss">
  .van-submit-bar{
    position: fixed;
    bottom: 50px;
    left: 0;
  }
</style>
